package com.yt.dao;

import com.yt.entity.Order;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

/**
 * @Classname OrderDao
 * @Description
 * @Date 2021/11/2 10:30
 * @Create by 杨涛
 */
@Mapper
public interface OrderDao {
    @Insert("INSERT into t_order(user_id,product_id,COUNT,money,STATUS) VALUES" +
            " (#{userId},#{productId},#{count},#{money},#{status})")
    void create( Order order);
    @Update("UPDATE t_order SET  status=#{status} where user_id=#{userId} and status = 0")
    void update(@Param("userId") Long userId, @Param("status") Integer status);
}
